<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>确认订单</title>
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0.maximum-scale=1.0,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/flexible.css">
    <script src="js/flexible.js"></script>
</head>
<body class="order" style="margin-bottom:0.5rem;">
<div class="common clearfix height38 title_back">
    <a href="#" class="lf color0 shopping_left postion">
        <img class="shopping_left_img" src="images/baileft.png">
        <span class="back">返回</span>
    </a>
    确认订单
</div>
<div class="distribution" style="margin-top:0.2rem;">
    <p class="mode"><span>配送方式</span><span class="marginleft10">到店自取</span></p>
    <p class="address">
        <!-- <span>店名</span> -->
        <span>舒曼健身会所</span></p>
    <p class="address">
        <!-- <span>地址</span> -->
        <span>双桥</span></p>
    <div class="leavingMessage clearfix">
        <p class="lf">卖家留言</p>
        <img class="rf" src="images/right_icon.png">
        <p class="rf marginright20">点击后添加留言</p>
    </div>
</div>
<div class="order_message clearfix">
    <div class="left_order">
        <img src="images/order.jpg">
    </div>
    <div class="right_order">
       <p class="order_title">春夏薄款运动速干紧身套装运动速干紧身套装春夏薄速干紧身套装</p>
       <!-- <p class="sales">
           <span>颜色：</span><span class="marginright10">粉色</span>
           <span>尺码：</span><span class="marginright10">L</span>
      </p> -->
       <p class="bottom_content">
           <span class="price_Icon colors">￥</span><span class="details_price colors unitPrice">198</span>
           <span class="rf add_order">
               <span onclick="reduce()" class="reduce"><img  src="images/reduce3.png" /></span>
               <span class="numbers">1</span>
               <span onclick="addNumber()" class="addNumber"><img   src="images/add1.png" /></span>
            </span>
        </p>
        <p class="all_order">
            <span class="rf">
                <span>总价</span>
                <span class="price_Icon">￥</span><span class="details_price all_nuber">198</span>
            </span>
            <span class="rf marginright02">
                <span>共&nbsp;</span><span class="number">1</span><span>&nbsp;件商品</span>
            </span>
        </p>
    </div>
</div>
<div class="sumbit">
    <p class="lf"><span>应付 ￥</span><span class="all_nuber"></span></p>
    <p class="rf">去付款</p>
</div>
</body>
<script src="js/jquery-3.3.1.min.js"></script>
<script>
    function reduce(){
        var number=$(".number").html();
        if(number==1){
            statas1();
        }else{
            number--;
            var price=parseInt($(".unitPrice").html());
            var  allprice=number*price;
            $(".all_nuber").html(allprice);
            $(".number").html(number);
        }
    }
    function addNumber(){
        var number=$(".number").html();
        //获取库存
        var Stock=8;
        if(number>=Stock){

        }else{
            number++;
            statas();
            var price=parseInt($(".unitPrice").html());
            var  allprice=number*price;
            $(".all_nuber").html(allprice);
            $(".number").html(number);
        }
    }
    // 如果商品数大于一，替换减号状态
    function statas(){
        $(".reduce img").attr("src","images/reduce2.png");
    }
    function statas1(){
        $(".reduce img").attr("src","images/reduce3.png");
    }
   
</script>
</html>